package com.xinshujia.task;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

/**
 * *************************************
 * *   @author: 野狼上校               **
 * *   @since: 2024-07-23 17:05       **
 * *   @version: 1.0                  **
 * *************************************
 * <p>
 */
public class QuartzTask extends QuartzJobBean {
    @Override
    protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
        // 在创建定时任务的时候把设备的deviceGuid作为定时任务的名称
        String key = context.getJobDetail().getKey().toString();
        String deviceGuid = key.substring(key.lastIndexOf(".") + 1);
        // 执行任务的逻辑（实时阈值设置）
        System.out.println(deviceGuid + ": run.......");
    }
}
